package com.example;

import com.example.dal.entity.DemoAuthor;
import com.example.dal.mapper.DemoAuthorMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan(basePackages = "com.example.dal.mapper")
public class AppPagehelper implements CommandLineRunner
{
	@Autowired
	DemoAuthorMapper demoAuthorMapper;

    public static void main( String[] args )
    {
        SpringApplication.run(AppPagehelper.class, args);
        System.out.println( "Hello World!" );
    }

    @Override
    public void run(String... args) throws Exception {
	    DemoAuthor demoAuthor = new DemoAuthor();
	    demoAuthor.setName("aaaaanotationName");
	    demoAuthorMapper.insert(demoAuthor);
    }
}
